# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kommit
pkgver=1.0.2
pkgrel=2
pkgdesc="Git GUI client for KDE"
url="https://apps.kde.org/kommit/"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="GPL-3.0-or-later"
makedepends="
	extra-cmake-modules
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kcrash5-dev
	kdbusaddons5-dev
	kdoctools5-dev
	ki18n5-dev
	kio5-dev
	ktexteditor5-dev
	ktextwidgets5-dev
	kxmlgui5-dev
	qt5-qtbase-dev
	samurai
	syntax-highlighting5-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/sdk/kommit.git"
source="https://download.kde.org/stable/kommit/kommit-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "(diff|clonedialog|overlay)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
0af4bd5cb5780e2554d99cfde55263edf9cd1aa61f509ff174b5890d014fd10dc4a61907e3f05aa0e491e8821aaf3163d0d26b46f79b37ca95b274e014224c74  kommit-1.0.2.tar.xz
"
